<template>
  <div class="home">
    {{ a}}{{ b }}
 <button @click="change(5)">change</button>
 <button @click="changeActions(10)">changeActions</button>
 <button @click="count(2)">change</button>
 <button @click="setCount(2)">setCount</button>

  </div>
</template>

<script>
// @ is an alias to /src

import { mapActions, mapGetters, mapMutations, mapState } from 'vuex';


export default {
  name: 'HomeView',
  data() {
    return {
      username: 'HomeView',
    }
  },
  computed: {
   ...mapState(['a','b']),
   ...mapState('count1',['count']),
   ...mapGetters('total'),
   fullname () {
    
    return this.username;
  }
  },
  methods: {
    ...mapMutations(['change']),
    ...mapMutations('count1',['setCount']),
    ...mapActions(['changeActions']),
    updateA(){
      // this.$store.commit('change',10);
      this.$store.dispatch('changeActions',5);
    }
  }
}
</script>
